package view.render
{
	import feathers.controls.ScrollContainer;
	import feathers.controls.Scroller;
	
	
	/**
	 * 带有scollerContainer的item基类
	 * @author £iang
	 * 
	 */	
	public class BaseScrollerItem extends BaseItem
	{
		//-----------------------------
		// variables
		//-----------------------------
		
		/** scollerContainer */
		public var scollerContainer:ScrollContainer;
		
		//-----------------------------
		// properties
		//-----------------------------
		
		//-----------------------------
		// setter&getter
		//-----------------------------
		
		//-----------------------------
		// methods
		//-----------------------------
		
		/**
		 * 初始化其他组件 
		 * 
		 */	
		override protected function initializeOther():void
		{
			scollerContainer = new ScrollContainer();
			scollerContainer.scrollerProperties.hasElasticEdges = false;
			scollerContainer.scrollerProperties.snapToPages = true;
			scollerContainer.scrollerProperties.throwEase = "easeOut";
			scollerContainer.scrollerProperties.interactionMode = 
				Scroller.INTERACTION_MODE_MOUSE;
			scollerContainer.scrollerProperties.scrollBarDisplayMode = 
				Scroller.SCROLL_BAR_DISPLAY_MODE_NONE;
			this.addChild( scollerContainer );
		}
		
		/**
		 * 改变ScrollerContainer的pageIndex 
		 * @param pageIndex pageIndex
		 * 
		 */		
		public function changeScrollerPage( pageIndex:int ):void
		{
			scollerContainer.scrollToPageIndex( pageIndex, 0, 0.5 );
		}
		
		
		override protected function disposeOther():void
		{
			disposeAnythingInContainer();
			scollerContainer.dispose();
			scollerContainer = null;
		}
		
		/**
		 * 清除container中的组件 
		 * 
		 */		
		protected function disposeAnythingInContainer():void
		{
			
		}
		
		//-----------------------------
		// events
		//-----------------------------
		
		//-----------------------------
		// dispose
		//-----------------------------
		
		//-----------------------------
		// construction
		//-----------------------------
		
		/**
		 * 构造函数
		 *
		 */
		public function BaseScrollerItem()
		{
			super();
		}
	}
}